TOOL_PATH= 
#OPTIMIZE_FOR_CPU=arm-none-linux-gnueabi-
ifndef PLAT_HISI
OPTIMIZE_FOR_CPU=/home/wywork/buildroot/build_arm/staging_dir/arm-linux/bin/
else
OPTIMIZE_FOR_CPU=/opt/hisi-linux/x86-arm/gcc-3.4.3-uClibc-0.9.28/usr/bin/arm-hismall-linux-
endif

MAKETOOLS=$(TOOL_PATH)$(OPTIMIZE_FOR_CPU)

#MAKETOOLS=

CC=$(MAKETOOLS)gcc
STRIP=$(MAKETOOLS)strip

OBJS = main.o serial.o sms.o sms_gb_uni.o sms_uni_gb.o
TARGET=sms

CFLAGS =   -O2 -Wall 
CFLAGS+=   -Wshadow -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations
CFLAGS+=   -Wmissing-prototypes -Wredundant-decls -Wnested-externs -Winline
#CFLAGS+=   -D CONFIG_REDFINCH2 
#-D CONFIG_AUX_PIN
#CFLAGS+= -I$(INCLUDE_DIR)
LFLAGS= 

all: $(TARGET)

%.o: %.c
	$(CC) -c $(CFLAGS) $< -o $@

$(TARGET): $(OBJS)
	$(CC) $(LFLAGS) -o $@ $(OBJS) 
	$(STRIP) --remove-section=.note --remove-section=.comment --strip-unneeded $(TARGET)

debug: $(OBJS)
	$(CC) $(LFLAGS) -o $@ $(OBJS) 
	

clean:
	rm -f $(OBJS) $(TARGET) 
